package com.hcryan.djm.exception;

/**
 * @author ryanwdj
 * @since 2025/2/18
 */
public class TravelException extends BusinessException {
    public TravelException(ErrorMessage message){
        super(message.getCode(), message.getMessage());
    }
    public TravelException(int code, String message) {
        super(code, message);
    }

    public TravelException(int code,String message,Object... args){
        super(code,String.format(message,args));
    }
    public TravelException(ErrorMessage message,Object... args){
        super(message.getCode(),String.format(message.getMessage(),args));
    }

    public TravelException(int code, String message, boolean toJsonMessage) {
        super(code, message, toJsonMessage);
        if (toJsonMessage) {
            this.toJsonMessage();
        }

    }

    public boolean equals(final Object o) {
        if (o == this) {
            return true;
        } else if (!(o instanceof TravelException)) {
            return false;
        } else {
            TravelException other = (TravelException)o;
            return other.canEqual(this);
        }
    }

    protected boolean canEqual(final Object other) {
        return other instanceof TravelException;
    }

    public int hashCode() {
        int result = 1;
        return result;
    }
}
